#ifndef _L_TRIANGLE_111225_H
#define _L_TRIANGLE_111225_H

#include <lmacros.h>
#include <lvectors.h>

LLIB_BEGIN
namespace geom {

/* The basic triangle classes */
/* 3D */
typedef Vec<Vec<Float,3>,3>     Tri3f;
typedef Vec<Vec<Int32,3>,3>     Tri3i;
typedef Vec<Vec<Boolean,3>,3>   Tri3b;
/* 2D */
typedef Vec<Vec<Float,2>,3>     Tri2f;
typedef Vec<Vec<Int32,2>,3>     Tri2i;
typedef Vec<Vec<Boolean,2>,3>   Tri2b;

/* The fundamental trianlge-triangle intersection tester */
class TriPairTester {
/* The static test stuff */
public:
    static Boolean TestStatic                       (Tri3f& t1, Tri3f& t2);
private:
    static Boolean TriangleTriangleIntersection_2D  (Tri2f& t1, Tri2f& t2);
    static Boolean PointInsideTriangle_2D           (Tri2f& t, Vec2f& p);

/*
public:
    static vector<CollisionInstant>
        TestDynamic(const Float deltaT, Triangle3f &firstLoc, Triangle3f &firstV, Triangle3f &secondLoc, Triangle3f &secondV);

private:

    const static Int16 VFtestVertexMap[6][4];
    const static Int16 EEtestVertexMap[9][4];

    inline static Float determinantValue(Vec3f &first, Vec3f &second, Vec3f &third);

    static vector<Float>
        DynamicVFtest(Float deltaT, Vec3f &p0, Vec3f &p1, Vec3f &p2, Vec3f &p3, Vec3f &v0, Vec3f &v1, Vec3f &v2, Vec3f &v3);
    static vector<Float>
        DynamicEEtest(Float deltaT, Vec3f &p0, Vec3f &p1, Vec3f &p2, Vec3f &p3, Vec3f &v0, Vec3f &v1, Vec3f &v2, Vec3f &v3);
    static vector<Float>
        CoplanarTest(Vec3f &p0, Vec3f &p1, Vec3f &p2, Vec3f &p3, Vec3f &v0, Vec3f &v1, Vec3f &v2, Vec3f &v3);
    static void
        ClampCoplanarCandidate(vector<Float> &candidates, Float deltaT);
    static Boolean
        PointInsideTriangle(Triangle3f &triangle, Vec3f &p);
    static Boolean
        SegmentCross(Vec3f &p0_start, Vec3f &p0_end, Vec3f &p1_start, Vec3f &p1_end);
*/
};





}
LLIB_END

#endif